<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/common.jspf"%>
<%@ include file="/common/taglibs.jspf"%>
<html lang="en">
  <head>
    <title><s:message code="login.platform.name" /></title>
    <meta name="decorator" content="none" />  
    <link href="${contextPath}/<s:theme code='path'/>/css/login.css" rel="stylesheet" />
    <!--page specific plugin scripts-->   
    <script src="${contextPath }/<s:theme code='path'/>/js/common.js"></script>
    
    <script src="${contextPath }/static/widgets/jquery-validate/js/jquery.validate.min.js"></script>
    <script src="${contextPath }/static/widgets/jquery-validate/js/jquery.validate.ex.js"></script>
    <c:if test="${!fn:startsWith(locale, 'en') && !empty locale }">
      <script src="${contextPath }/static/widgets/jquery-validate/i18n/messages_${locale}.js"></script>
    </c:if>
    <script src="${contextPath }/static/widgets/jquery-form/jquery.form.min.js"></script>   
  </head>
  <body>  
<!--[if lte IE 6]><br/><div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a><h4>温馨提示：</h4><p>你使用的浏览器版本过低。为了获得更好的浏览体验，我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器，或者使用较新版本的 Chrome、Firefox、Safari 等。</p></div><![endif]-->

<div id="login-container">
  <div id="login-header">
    <h3 style="line-height: 15px;"><s:message code="login.platform.name" /></h3>
  </div> <!-- /login-header -->
  <div id="login-content" class="clearfix">  
      <form id="activate-form" class="form-vertical" action="activate.json" method="post">
        <input type="hidden" name="code" value="${code }">
        <h3 class=""><s:message code="activate" /></h3>    
        <div class="control-group">
          <label class="control-label"><s:message code='login.loginId' /></label>
          <div class="controls">
            <div class="input-prepend">
              <span class="add-on"><i class="icon-envelope"></i></span>
              <input class="" type="text" name="email" value="${userInfo.email }" readonly="readonly"/>             
            </div>
          </div>
        </div> 
        <div class="control-group">
          <label class="control-label visible-ie8 visible-ie9"><s:message code='login.password' /></label>
          <div class="controls">
            <div class="input-prepend">
              <span class="add-on"><i class="icon-lock"></i></span>
              <input class="" type="password" id="register_password" placeholder="<s:message code='login.password' />" name="password"/>
            </div>
            <span class="help-block visible-ie8 visible-ie9 text-muted"><s:message code='register.password.help' /></span>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label visible-ie8 visible-ie9"><s:message code='login.rpassword' /></label>
          <div class="controls">
            <div class="input-prepend">
              <span class="add-on"><i class="icon-ok"></i></span>
              <input class="" type="password" placeholder="<s:message code='login.rpassword' />" name="rpassword"/>             
            </div>
            <span class="help-block visible-ie8 visible-ie9 hide text-muted"><s:message code='login.rpassword.help' /></span>
          </div>
        </div>   
        <div class="form-actions">          
          <button type="submit" id="activate-submit-btn" class="btn btn-warning">
          <s:message code="btn.activate" />
          </button>            
        </div>
      </form>
      <!-- END REGISTRATION FORM -->        
    </div> <!-- /login-content -->
    
    <div id="login-extra">  
            <p>Copyright &copy; 2004~2015 <a href="www.littcore.com" target="_blank">LITTCORE</a>, all rights reserved.</p>     
      <p>联系电话：13818143407 &nbsp;&nbsp;E-mail: <a href="mailto:services@littcore.com">services@littcore.com</a></p>
    </div> <!-- /login-extra -->
  
</div> <!-- /login-wrapper -->
    <!-- inline scripts related to this page -->
    <script type="text/javascript">    
      $(document).ready(function() {
        $('#activate-form').validate({
          focusInvalid : false, // do not focus the last invalid input            
          rules : {
            password : {
              required : true
            },
            rpassword : {
              required : true,
              equalTo : "#register_password"
            },
          },
          submitHandler : function(form) {
            $(form).ajaxSubmit({
              dataType : 'json',
              success : function() {
                location.href = "${contextPath}/main.do";
              }

            });
            return false;
          },
          highlight: function (element) { // hightlight error inputs
            $(element)
                .closest('.control-group').addClass('error'); // set error class to the control group
          },  
          success: function (element) {
            element.closest('.control-group').removeClass('error');
            element.remove();
          },
        });
      });
    </script>
  </body>
</html>
